#-*- coding: utf-8 -*-
#coding:utf-8
import sys
reload(sys)
sys.setdefaultencoding('utf-8')

from sys import argv
script,device=argv
import mysql.connector
conn=mysql.connector.connect(user='root',password='',host='127.0.0.1',port='3306',database='recharge',charset='utf8')
cursor=conn.cursor();

sql="select id,server,account,password,role,area,rechargeType,money from recharge_task where 1 or mobileNum='%s' order by rand()  limit 1"%device


cursor.execute(sql)
value=cursor.fetchone()

if value is None:
    print 0
else:
    print value[0],'~',value[1],'~',value[2],'~',value[3],'~',value[4],'~',value[5],'~',value[6],'~',value[7]

conn.close()



